package com.li.sssp.server;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.li.sssp.entity.ModuleMast;
import com.li.sssp.repository.ModuleMastRepository;

@Service
public class ModuleMastService {

	@Autowired
	private ModuleMastRepository mmRepository;

	/**
	 * 获取所有最顶层模块数据
	 * @return
	 */
	@Transactional
	public List<ModuleMast> GetAll() {
		return mmRepository.findAll();
	}

	/**
	 * 根据Id获取最顶层数据
	 * @param id
	 * @return
	 */
	
	public ModuleMast GetById(Integer id) {
		return mmRepository.findOne(id);
	}
}
